﻿/* 
 * author: www.cnblogs.com/luminji
 * date  : 2011/12/28
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Luminji.Exam.Model.Papers;
using Luminji.Infrastructure.DomainBase;

namespace Luminji.Exam.Model.PaperTemplates
{
    public class PaperTemplate : EntityBase
    {
        public PaperTemplate()
        {
            CreateTime = new DateTime(2000, 1, 1);
        }

        public string PaperTemplateCode { get; set; }
        public string PaperTemplateName { get; set; }

        public string SubjectCode { get; set; }
        public string SubjectName { get; set; }

        public System.DateTime CreateTime { get; set; }
        public string Creator { get; set; }

        public virtual IEnumerable<PaperTemplatePart> PaperTemplateParts { get; set; }

        public override bool Equals(object obj)
        {
            var pt = obj as PaperTemplate;
            if (pt == null)
            {
                return false;
            }
            return (this.PaperTemplateCode == pt.PaperTemplateCode && this.PaperTemplateName == pt.PaperTemplateName);
        }

        public override int GetHashCode()
        {
            return (this.PaperTemplateCode + this.PaperTemplateName).GetHashCode();
        }
    }
}
